function onLoad() {
    require(["html-header", "pointBackground"]);
    require(["css!../css/markdown_html.css"]);
    require(["markdown-it", "highlight"], function(md, hljs) {
        //md.highlight = function(str, lang) {
        //    try {
        //        return '<pre class="hljs"><code>' +
        //            hljs.highlight(lang, str, true).value +
        //            '</code></pre>';
        //    } catch (__) {}
        //}
        //md.html = true;
        window.md = md;
        window.hljs = hljs;
    });
    $("#inputBox").on("input", () => {
        let input = $("#inputBox").val();
        let result = md("default", {
            highlight: function(str, lang) {
                try {
                    return '<pre class="hljs"><code>' +
                        hljs.highlight(lang, {
                            language: lang,
                            ignoreIllegals: true
                        }).value +
                        '</code></pre>';
                } catch (__) {}
                return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>'
            },
            html: true,
            linkify: true,
            typographer: true,
            langPrefix: 'language-',
        }).render(input);
        $("#outputBox").html(result);
    })
}
